home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / OpenTransport / Open Tpt Module Developer / Includes / OpenTptPCISupport.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-24  |  3.5 KB  |  113 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        OpenTptPCISupport.h
  3.  
  4.     Contains:    File to include everything you need to declare a module
  5.  
  6.     Copyright:    © 1993-1995 by Apple Computer, Inc., all rights reserved.
  7.  
  8.  
  9. */
  10.  
  11. #ifndef __OPENTPTPCISUPPORT__
  12. #define __OPENTPTPCISUPPORT__
  13.  
  14. #ifndef __OPENTPTCOMMON__
  15. #include <OpenTptCommon.h>
  16. #endif
  17. #ifndef __DEVICES__    
  18. #include <Devices.h>
  19. #endif
  20.  
  21. #if PRAGMA_ALIGN_SUPPORTED
  22. #pragma options align=mac68k
  23. #endif
  24.  
  25. /*******************************************************************************
  26. ** This is the cookie that is passed to your STREAM Module
  27. ********************************************************************************/
  28.  
  29. struct OTPCIInfo
  30. {
  31.     RegEntryID            fTheID;
  32.     void*                fConfigurationInfo;
  33.     size_t                fConfigurationLength;
  34. };
  35.  
  36. typedef struct OTPCIInfo OTPCIInfo;
  37.  
  38. /*******************************************************************************
  39. ** PCI Card support
  40. ********************************************************************************/
  41. /*
  42.  * All PCI card modules should have the following bits set in their
  43.  * install_info structure:
  44.  * kOTModIsDriver.
  45.  * 
  46.  * They should NEVER have the kOTModPushAlways or the kOTModIsModule
  47.  * flags set.
  48.  *
  49.  * The kOTModIsLowerMux bits should be set if the driver is a lower
  50.  * multiplexor, although Open Transport does nothing with the information
  51.  * today.
  52.  *
  53.  * The kOTModUpperIsDLPI bit should be set if the driver uses the DLPI message
  54.  * specification.  The kOTModUpperIsTPI bit should be set if the driver uses
  55.  * the TPI message specification.
  56.  */
  57.  
  58.  /*    -------------------------------------------------------------------------
  59.     Macro to put together the driverServices.service[x].serviceType field
  60.     
  61.     // xxxxxddd dddddddd ffffffff xxxxxxTD
  62.     //
  63.     // where "d" is the device type for Open Transport,
  64.     // the lower two bits are whether the driver is TPI or DLPI,
  65.     // and the "f" bits are the framing option flags.
  66.     // and all other bits should be 0
  67.     ------------------------------------------------------------------------- */
  68.  
  69. #define OTPCIServiceType(devType, framingFlags, isTPI, isDLPI)    \
  70.     ((devType << 16) | (((framingFlags) & 0xff) << 8) | (isTPI ? 2 : 0) | (isDLPI ? 1 : 0 ))
  71.  
  72.  /*    -------------------------------------------------------------------------
  73.     Typedef for the ValidateHardware function.  This function will be
  74.     called only once, at system boot time, before installing your driver
  75.     into the Open Transport module registry.
  76.     The param pointer will is a RegEntryIDPtr - don't be changing the
  77.     values there!
  78.     ------------------------------------------------------------------------- */
  79.  
  80. typedef OTResult    (* _CDECL ValidateHardwareProcPtr)(OTPCIInfo* param);
  81.  
  82. enum
  83. {
  84.     kOTPCINoErrorStayLoaded        = 1
  85. };
  86.  
  87. /*    -------------------------------------------------------------------------
  88.     Some descriptors we use - these should eventually show up
  89.     in system header files somewhere.
  90.     ------------------------------------------------------------------------- */
  91.  
  92. #define kDescriptorProperty        "driver-descriptor"
  93. #define kDriverProperty            "driver,AAPL,MacOS,PowerPC"
  94. #define kDriverPtrProperty        "driver-ptr"
  95. #define kSlotProperty            "AAPL,slot-name"
  96.  
  97. /*    -------------------------------------------------------------------------
  98.     Maximum # of services support by Open Transport.  If your module
  99.     exports more than this # of services, Open Transport will not be
  100.     able to use the module.
  101.     ------------------------------------------------------------------------- */
  102.  
  103. enum
  104. {
  105.     kMaxServices                = 20
  106. };
  107.  
  108. #if PRAGMA_ALIGN_SUPPORTED
  109. #pragma options align=reset
  110. #endif
  111.  
  112. #endif    /* __OPENTPTPCISUPPORT__ */
  113.